#! /usr/bin/python

import math
import time

tt = time.time()

limit = 10**8
count = 0

def gcd(a, b):
    if b == 0: return a
    return gcd(b, a%b)

for m in range(1, int(math.sqrt(limit/4) + 1)):
    for n in range(m+1, int(math.sqrt(limit/2) + 1)):
	a = 2*m*n
	b = n**2 - m**2
	c = n**2 + m**2
	p = a + b + c
	if p > limit: break
	if c%(b-a) == 0 and gcd(a, b) == 1: 
	   print a, b, c
	   count += limit/p
print count
print time.time() - tt
